<template>
    <div id="main" style="width: 500px; height: 300px;">
    </div>
</template>

<script setup>
import {
    onMounted
} from 'vue'
import cardJson from './card.json'
// 定义配置属性
const props = defineProps({
    initProp: {
        type: Object,
        default() {
            return cardJson.initProp
        }
    }
})
import * as echarts from 'echarts/core';
import { GridComponent } from 'echarts/components';
import { LineChart } from 'echarts/charts';
import { UniversalTransition } from 'echarts/features';
import { CanvasRenderer } from 'echarts/renderers';

echarts.use([GridComponent, LineChart, CanvasRenderer, UniversalTransition]);

onMounted(() => {

    var chartDom = document.getElementById('main');
    var myChart = echarts.init(chartDom, 'dark');
    var option;

    option = {
        xAxis: {
            type: 'category',
            data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
        },
        yAxis: {
            type: 'value'
        },
        series: [
            {
                data: [150, 230, 224, 218, 135, 147, 260],
                type: 'line'
            }
        ]
    };

    option && myChart.setOption(option);
})
</script>



